from com.oot2d import *
import random

def move_random():
    random.seed()
    x = random.randint(0, 8)
    if x == 0:
        api.moveBy(npc, random.randint(-50, -10), 0, 0.025)
    elif x == 1:
        api.moveBy(npc, random.randint(10, 50), 0, 0.025)
    elif x == 2:
        api.moveBy(npc, 0, random.randint(-50, -10), 0.025)
    elif x == 3:
        api.moveBy(npc, 0, random.randint(10, 50), 0.025)
    else:
        api.delay(npc, random.randint(500, 1500))

def wait_move():
    random.seed()
    api.delay(npc, random.randint(500, 2000))
    x = random.randint(0, 3)
    #Change animation to face
    n = random.randint(10, 50)
    if x == 0:
        move_up(n)
    elif x == 1:
        move_down(n)
    elif x == 2:
        move_left(n)
    else:
        move_right(n)

def move_up(n):
    api.moveBy(npc, 0, -n, 0.025)
    
def move_down(n):
    api.moveBy(npc, 0, n, 0.025)
    
def move_left(n):
    api.moveBy(npc, -n, 0, 0.025)
    
def move_right(n):
    api.moveBy(npc, n, 0, 0.025)
